#include "EchoServer.h"
#include "web/WebPageSearcher.h"
#include "web/KeyRecommander.h"

#include "../../include/Configuration.h"
#include <iostream>

using std::cout;
using std::endl;

int main(int argc, char **argv) {
    Configuration* conf = Configuration::getInstance();
    auto &conf_map = conf->getConfigMap();

    int threadNum = atoi(conf_map["THREAD_NUM"].c_str());
    int queSize = atoi(conf_map["QUE_SIZE"].c_str());
    string ip = conf_map["IP"];
    int port = atoi(conf_map["PORT"].c_str());

    // 预热初始化内存数据
    WebpageQuery::getInstance();
    Dict::getInstance(1);
    Dict::getInstance(2);

    EchoServer server(3, queSize, ip, port);
    server.start();

    return 0;
}

